/**
 * @description: Login interface parameters
 */
export interface LoginParams {
  captcha?: string;
  captchaLength?: string | number;
  captcha_id?: string;
  password: string;
  username: string;
}

export interface RoleInfo {
  roleName: string;
  value: string;
}

export interface LoginAdminItem {
  created_at: string;
  creator: number;
  creator_ids: string;
  google_changed: number;
  id: number;
  last_login_ip: string;
  last_login_time: string;
  login_ip: string;
  login_time: string;
  part: string;
  role: number;
  role_name: string;
  status: number;
  token: string;
  real_name: string;
  updated_at: string;
  username: string;
  roles?: RoleInfo[];
}

interface MenuItem {
  component: string;
  icon: string;
  id: number;
  is_show: number;
  level: number;
  name: string;
  order: number;
  parent_id: number;
  title: string;
  url: string;
  created_at: string;
  updated_at: string;
  children?: MenuItem[];
}

type MenuStructure = MenuItem[];

/**
 * @description: Login interface return value
 */
export interface LoginResultModel {
  expires_at: string | number;
  access_token: string;
  roles?: RoleInfo[];
  menu?: MenuStructure;
  admin: LoginAdminItem;
}

/**
 * @description: Get user information return value
 */
export interface GetUserInfoModel {
  roles: RoleInfo[];
  // 用户id
  userId: string | number;
  // 用户名
  username: string;
  // 真实名字
  real_name: string;
  // 真实名字
  realName: string;
  // 头像
  avatar: string;
  // 介绍
  desc?: string;

  description?: string;
  enable?: boolean;
  needResetPassword?: boolean;
  role?: string | number;
}
